import {createRouter, createWebHistory} from 'vue-router'
import Layout from '../layout/Layout.vue'
import Login from "@/views/Login";
import Register from "@/views/Register";


const routes = [
    //全布局路由
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect:"/aboutMe",
        children: [
            //Blog
            {
                path: '/blog',
                name: 'Blog',
                component: () => import("@/views/Blog"),
            },
            //About Me
            {
                path: '/aboutMe',
                name: 'AboutMe',
                component: () => import("@/views/AboutMe"),
            },
            //Recommended
            {
                path: '/recommended',
                name: 'Recommended',
                component: () => import("@/views/Recommended"),
            },
            //Resume
            {
                path: '/resume',
                name: 'Resume',
                component: () => import("@/views/Resume"),
            },
            //Portfolio
            {
                path: '/portfolio',
                name: 'Portfolio',
                component: () => import("@/views/Portfolio"),
            },
            //Contact
            {
                path: '/contact',
                name: 'Contact',
                component: () => import("@/views/Contact"),
            },
            //PersonalInformation
            {
                path: '/personalInformation',
                name: 'PersonalInformation',
                component: () => import("@/views/PersonalInformation"),
            },
            //User
            {
                path: '/user',
                name: 'User',
                component: () => import("@/views/User"),
            },

        ]
    },
    //登录
    {
        path: '/login',
        name: 'Login',
        component: Login,
    },
    //注册
    {
        path: '/register',
        name: 'Register',
        component: Register,
    }


]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
